import store from '@/store'
import { myDebounce } from "./tools";

const scrollFunc = () => {
  store.commit('content/SET_ISSCROLL', true)
  endScroll()
}
const _endScroll = () => {
  store.commit('content/SET_ISSCROLL', false)
}
const endScroll = myDebounce(_endScroll, 100)

export function scrollEvent(){
  document.addEventListener('DOMMouseScroll',scrollFunc)
  window.onmousewheel = document.onmousewheel = scrollFunc; //IE/Opera/Chrome
}